package com.sina.interfaces.core.util;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.Map;

/**
 * Created by Backache on 2017/8/31.
 * Map工具类
 */
public class MapUtils {
    /**
     * 将给定Object转换为Map
     */
    public static <K,V> Map<K,V> convertToMap(Object object) {
        ObjectMapper objectMapper = new ObjectMapper();
        return objectMapper.convertValue(object, Map.class);
    }
}
